package com.ict.config;

import java.util.Timer;
import java.util.TimerTask;

import org.apache.log4j.Logger;

import com.ict.dataprocess.OrigMQToRedis;
import com.ict.utils.MQTopicConsume;

public class OrigMainClass {
	private static Logger logger = Logger.getLogger(OrigMainClass.class);
	public static void main(String[] args) {
		String []  rountingKey= {Config.origTargetRoutingKey};
		MQTopicConsume mqTopicConsume = new MQTopicConsume(Config.recvMQIP, Config.recvMQPort, Config.recvMQUserName, Config.recvMQPasswd,
	                "xgs", rountingKey,"xgs_tap_orig_by_tlc");
		 mqTopicConsume.ConsumeOrig();
		 TimerTask task = new TimerTask() {
			@Override
			public void run() {
				System.out.println("fuse main Run");
				OrigMQToRedis mqToRedis = new OrigMQToRedis();
				mqToRedis.run();
				
			}
		};
		Timer timer = new Timer();
		long delay = 0;
		long intevalPeriod = 1 * Config.timeCycle;
		timer.scheduleAtFixedRate(task, delay, intevalPeriod);
	}
	

}
